function data = dataForSMM(params,calibrateParams,orderApp,T,selectY,setupEPer,appMethod)

% Adding the calibrated values to params
selectParams = fieldnames(params);
namesCalibrate = setdiff(fieldnames(calibrateParams),selectParams);
for i=1:size(namesCalibrate,1)
   name = namesCalibrate(i);  
   params.(name{1}) = calibrateParams.(name{1}); 
end

[model,errorMes] = perturbationDSGEmodel(params,orderApp);
% Generating N.i.d. shocks to the economy
rng(1,'twister'); 
shocks = randn(model.ne,T); %Simulating from a random normal
if appMethod == 1
    ySim = sim3rdPrun(model,shocks,orderApp);
elseif appMethod == 2
    setupEPer = infoToSetupEPer(model,setupEPer,orderApp);
    ySim = simExtendedPer(model,shocks,setupEPer);
end
[ySim] = untransformYandX(ySim,model);
data = ySim(selectY,:)';

end

